package com.hmdp.exception;

import com.hmdp.dto.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(WebException.class)
    public Result error(WebException e) {
        e.printStackTrace();
        return Result.fail(e.getMessage());
    }
}
